Optimal. Leaf size=106 \[ \frac {1}{2} \left (2 b c d+a \left (2 c^2+d^2\right )\right ) x-\frac {2 \left (3 a c d+b \left (c^2+d^2\right )\right ) \cos (e+f x)}{3 f}-\frac {d (2 b c+3 a d) \cos (e+f x) \sin (e+f x)}{6 f}-\frac {b \cos (e+f x) (c+d \sin (e+f x))^2}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 106, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {2832, 2813}
\begin {gather*} -\frac {2 \left (3 a c d+b \left (c^2+d^2\right )\right ) \cos (e+f x)}{3 f}+\frac {1}{2} x \left (a \left (2 c^2+d^2\right )+2 b c d\right )-\frac {d (3 a d+2 b c) \sin (e+f x) \cos (e+f x)}{6 f}-\frac {b \cos (e+f x) (c+d \sin (e+f x))^2}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2813
Rule 2832
Rubi steps
\begin {align*} \int (a+b \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx &=-\frac {b \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}+\frac {1}{3} \int (c+d \sin (e+f x)) (3 a c+2 b d+(2 b c+3 a d) \sin (e+f x)) \, dx\\ &=\frac {1}{2} \left (2 b c d+a \left (2 c^2+d^2\right )\right ) x-\frac {2 \left (3 a c d+b \left (c^2+d^2\right )\right ) \cos (e+f x)}{3 f}-\frac {d (2 b c+3 a d) \cos (e+f x) \sin (e+f x)}{6 f}-\frac {b \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.36, size = 90, normalized size = 0.85 \begin {gather*} \frac {6 \left (2 b c d+a \left (2 c^2+d^2\right )\right ) (e+f x)-3 \left (4 b c^2+8 a c d+3 b d^2\right ) \cos (e+f x)+b d^2 \cos (3 (e+f x))-3 d (2 b c+a d) \sin (2 (e+f x))}{12 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 115, normalized size = 1.08
method | result | size |
derivativedivides | \(\frac {c^{2} a \left (f x +e \right )-2 a c d \cos \left (f x +e \right )+d^{2} a \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-b \,c^{2} \cos \left (f x +e \right )+2 b c d \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b \,d^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(115\) |
default | \(\frac {c^{2} a \left (f x +e \right )-2 a c d \cos \left (f x +e \right )+d^{2} a \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-b \,c^{2} \cos \left (f x +e \right )+2 b c d \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b \,d^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(115\) |
risch | \(a \,c^{2} x +\frac {x \,d^{2} a}{2}+x b c d -\frac {2 \cos \left (f x +e \right ) a c d}{f}-\frac {\cos \left (f x +e \right ) b \,c^{2}}{f}-\frac {3 \cos \left (f x +e \right ) b \,d^{2}}{4 f}+\frac {b \,d^{2} \cos \left (3 f x +3 e \right )}{12 f}-\frac {\sin \left (2 f x +2 e \right ) d^{2} a}{4 f}-\frac {\sin \left (2 f x +2 e \right ) b c d}{2 f}\) | \(117\) |
norman | \(\frac {\left (c^{2} a +\frac {1}{2} d^{2} a +b c d \right ) x +\left (c^{2} a +\frac {1}{2} d^{2} a +b c d \right ) x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (3 c^{2} a +\frac {3}{2} d^{2} a +3 b c d \right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (3 c^{2} a +\frac {3}{2} d^{2} a +3 b c d \right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\frac {d \left (a d +2 b c \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {12 a c d +6 b \,c^{2}+4 b \,d^{2}}{3 f}-\frac {\left (4 a c d +2 b \,c^{2}\right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {\left (8 a c d +4 b \,c^{2}+4 b \,d^{2}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {d \left (a d +2 b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{3}}\) | \(259\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 121, normalized size = 1.14 \begin {gather*} \frac {12 \, {\left (f x + e\right )} a c^{2} + 6 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b c d + 3 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a d^{2} + 4 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b d^{2} - 12 \, b c^{2} \cos \left (f x + e\right ) - 24 \, a c d \cos \left (f x + e\right )}{12 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 94, normalized size = 0.89 \begin {gather*} \frac {2 \, b d^{2} \cos \left (f x + e\right )^{3} + 3 \, {\left (2 \, a c^{2} + 2 \, b c d + a d^{2}\right )} f x - 3 \, {\left (2 \, b c d + a d^{2}\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 6 \, {\left (b c^{2} + 2 \, a c d + b d^{2}\right )} \cos \left (f x + e\right )}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 199 vs.
\(2 (97) = 194\).
time = 0.18, size = 199, normalized size = 1.88 \begin {gather*} \begin {cases} a c^{2} x - \frac {2 a c d \cos {\left (e + f x \right )}}{f} + \frac {a d^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a d^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {a d^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {b c^{2} \cos {\left (e + f x \right )}}{f} + b c d x \sin ^{2}{\left (e + f x \right )} + b c d x \cos ^{2}{\left (e + f x \right )} - \frac {b c d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {b d^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b d^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right ) \left (c + d \sin {\left (e \right )}\right )^{2} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 96, normalized size = 0.91 \begin {gather*} \frac {b d^{2} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} + \frac {1}{2} \, {\left (2 \, a c^{2} + 2 \, b c d + a d^{2}\right )} x - \frac {{\left (4 \, b c^{2} + 8 \, a c d + 3 \, b d^{2}\right )} \cos \left (f x + e\right )}{4 \, f} - \frac {{\left (2 \, b c d + a d^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.89, size = 108, normalized size = 1.02 \begin {gather*} -\frac {\frac {3\,a\,d^2\,\sin \left (2\,e+2\,f\,x\right )}{2}-\frac {b\,d^2\,\cos \left (3\,e+3\,f\,x\right )}{2}+6\,b\,c^2\,\cos \left (e+f\,x\right )+\frac {9\,b\,d^2\,\cos \left (e+f\,x\right )}{2}+3\,b\,c\,d\,\sin \left (2\,e+2\,f\,x\right )-6\,a\,c^2\,f\,x-3\,a\,d^2\,f\,x+12\,a\,c\,d\,\cos \left (e+f\,x\right )-6\,b\,c\,d\,f\,x}{6\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________